<?php
class SystemController extends CController {
	public function actionIndex() {
		$smarty = Yii::app ()->smarty;
		$syconfig = new Sysconfig ( );
		$template = new Template ( );
		$tpl = $template->getTplByType ( "all" );
		$config = $syconfig->getConfigByType ();
		$smarty->assign ( "tpl", $tpl );
		$smarty->assign ( "config", $config );
		$smarty->display ( "system.html" );
	}
	
	public function actionUpdate() {
		$syconfig = new Sysconfig ( );
		$syconfig->updateAll ( array (
			
			"webname" => addslashes ( $_POST ['webname'] ), 
			"url" => addslashes ( $_POST ['url'] ), 
			"title" => addslashes ( $_POST ['title'] ), 
			"keywords" => addslashes ( $_POST ['keywords'] ), 
			"description" => addslashes ( $_POST ['description'] ), 
			"record" => addslashes ( $_POST ['record'] ), 
			"systemplate" => addslashes ( $_POST ['systemplate'] ), 
			"webtemplate" => addslashes ( $_POST ['webtemplate'] ) 
		), array (
			
			"condition" => "type='sysconfig'" 
		) );
		echo CommonFunc::AjaxCallbackMessage('200','操作成功2','','forward','');
	}
}
?>